cmake_minimum_required(VERSION 3.10)
project(ThreadExamples C)

set(CMAKE_C_STANDARD 99)

add_executable(pipe pipe.c)
add_executable(read_fifo read_fifo.c)
add_executable(write_fifo write_fifo.c)
add_executable(msg_send msg_send.c)
add_executable(msg_recv msg_recv.c)
add_executable(shm_read shm_read.c)
add_executable(shm_wirte shm_write.c)
add_executable(zombie zombie.c)
add_executable(sigaction sigaction.c)
add_executable(pthread_create_exp pthread_create_exp.c)
add_executable(pthread_exit_exp pthread_exit_exp.c)
add_executable(mutex_exp mutex_exp.c)
add_executable(cond_exp cond_exp.c)
add_executable(sem_exp sem_exp.c)

find_package(Threads REQUIRED)
target_link_libraries(pthread_create_exp Threads::Threads)
target_link_libraries(pthread_exit_exp Threads::Threads)
target_link_libraries(mutex_exp Threads::Threads)
target_link_libraries(cond_exp Threads::Threads)
target_link_libraries(sem_exp Threads::Threads)
